import time
from selenium import webdriver
from selenium.webdriver.common.by import By

driver=webdriver.Chrome()
driver.maximize_window()
driver.get("https://www.baidu.com")
time.sleep(2)
#根据文本内容精确匹配
driver.find_element(By.XPATH,'//span[text()="换一换"]').click()
time.sleep(2)
#根据文本内容模糊匹配
driver.find_element(By.XPATH,'//span[contains(text(),"一换")]').click()


time.sleep(8)
driver.quit()
